<?php
/**
 * The html template file of index method of student module of ZenTaoPHP.
 *
 * The author disclaims copyright to this source code.  In place of
 * a legal notice, here is a blessing:
 * 
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */
?>
<?php include '../../common/view/header.html.php';?>
<div class='container'>
  <div class='panel'>
  <div class='panel-heading'>
      <?php $lang = $this->lang->student;?>
      <strong> <?php echo $lang->index;?></strong>
      <div class='pull-right'> <?php echo html::a(inlink('export'), $lang->export, "class='btn btn-primary btn-xs'");?></div>
      <div class='pull-right' style="margin-right: 20px;"> <?php echo html::a(inlink('create'), $lang->add, "class='btn btn-primary btn-xs'");?></div>
  </div>
  <table class='table table-list table-hover'> 
    <thead>
      <tr>
        <td ><?php echo $lang->id;?></td>
        <td><?php echo $lang->campus;?></td>
        <td><?php echo $lang->student;?></td>
        <td><?php echo $lang->sex;?></td>
        <td><?php echo $lang->school;?><?php echo $lang->class;?><?php echo $lang->grade;?></td>
          <td><?php echo $lang->action;?></td>
      </tr>
    </thead>
    <tbody>
      <?php foreach($students as $student):?>
      <tr>
          <?php
            if($student->sex == 0){
                $sex = "男";
            }else if ($student->sex == 1) {
                $sex = "女";
            } else {
                $sex = "未知";
            }
          ?>
        <td><?php echo $student->id;?></td>
        <td><?php echo $student->campus;?></td>
        <td><?php echo $student->student;?></td>
        <td><?php echo $sex?></td>
        <td><?php echo $student->school;?><?php echo $student->class;?><?php echo $student->grade;?></td>
        <td>
          <?php
          $studentName = base64_encode(base64_encode($student->student));
          echo html::a($this->createLink('student', 'view',   "id=$student->id"), $lang->view);
          echo html::a($this->createLink('student', 'edit',   "id=$student->id"), $lang->edit);
          echo html::a($this->createLink('student', 'delete', "id=$student->id"), $lang->delete);
          echo html::a($this->createLink('student', 'charge', "id=$student->id&studentName=$studentName"), $lang->charge);
          ?>
        </td>
      </tr>  
      <?php endforeach;?>  
    </tbody>
    <tfoot>
      <tr>
        <td colspan='6'>
          <?php 
          $pager->show('right', 'short');
          ?>
        </td>
      </tr>  
    </tfoot>
  </table>
</div>
</div>
<?php include '../../common/view/footer.html.php';?>
